import json,yaml

test_file = open("ymldir/test.yaml","r", encoding="utf-8")
#先将yaml转换为dict格式
generate_dict = yaml.load(test_file,Loader=yaml.FullLoader)
generate_json = json.dumps(generate_dict,sort_keys=False,indent=4,separators=(',',': '))
print(generate_json)

def foo():
    pass

if __name__ == "__main__":
    foo()
